import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'

import zh from './langs/zh.json'
import en from './langs/en.json'
export const SupportedLngs = ['en', 'zh'] as const
i18n.use(initReactI18next).init({
  resources: {
    zh: {
      translation: zh,
    },
    en: {
      translation: en
    },
  },
  lng: 'zh',
  supportedLngs: SupportedLngs,
  fallbackLng: 'zh',// 默认当前的语言环境
  interpolation: {
    escapeValue: false, // react already safes from xss
  },
}, (err, t) => {
  console.log(err, t)
})
export default i18n;

